package com.xxzuibang.day10.多态.poly_.polyarr_;

public class PloyArray {
    public static void main(String[] args) {
Person2[] person2s=new Person2[5];
person2s[0]=new Person2("huang",10);
person2s[1]=new Student2("hong",12 ,1,100);
person2s[2]=new Student2("long",13,2,99.0);
person2s[3]=new Teacher2("ying",14,3,1000 );
person2s[4]=new Teacher2("wong",15,4,2000);
        for (int i = 0; i < person2s.length; i++) {
            System.out.println(person2s[i].say());
        }
    }
}
